package com.cdtye.itps.cms.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 *
 * @author wzw
 */
@Component
@ConfigurationProperties(prefix = "cms")
public class CmsConfig {
    /** 项目名称**/
    private String name;

    /** 项目版本**/
    private String version;

    /** 上传路径**/
    private static String resource;

    /** 项目名称**/
    private static String prefix;

    /** 算法文件路径**/
    private static String algorithmDirectory;

    public String getAlgorithmDirectory() {
        return algorithmDirectory;
    }

    public void setAlgorithmDirectory(String algorithmDirectory) {
        this.algorithmDirectory = algorithmDirectory;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getVersion(){
        return version;
    }

    public void setVersion(String version){
        this.version = version;
    }

    public static String getResource(){
        return resource;
    }

    public void setResource(String resource){
        CmsConfig.resource = resource;
    }

    public static String getPrefix(){
        return prefix;
    }

    public void setPrefix(String prefix){
        CmsConfig.prefix = prefix;
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getResource() + "/upload";
    }

    /**
     * 获取导入上传路径
     */
    public static String getImportPath()
    {
        return getResource() + "/import";
    }

}
